<?php
	require I_PATH . 'xml.php';
	
	if (!isAdminConnected()) die('vous n\'êtes pas autorisé à voir cette page!');
	
	
	$dvds = $dvd_dom->getElementsByTagName('dvds')->item(0);
	
	echo '<table class="rounded-corner"><tr><th class="rounded-th-l">ID</th><th>Titre</th><th>Prix</th><th class="rounded-th-r">Quantité</th></tr>';
	
	foreach ($dvds->getElementsByTagName('dvd') as $dvd) {
		$id = $dvd->getAttributeNode('id')->value;
		echo '<tr><td>'.$id.'</td>';
		
		echo '<td>' . $dvd->getElementsByTagName('title')->item(0)->nodeValue . '</td>';
		echo '<td>' . $dvd->getElementsByTagName('price')->item(0)->nodeValue . '€</td>';
		echo '<td>' . $dvd->getElementsByTagName('dvdcount')->item(0)->nodeValue . '</td>';
		echo '<td><a href="?p=adddvd&id_dvd='.$id.'">modifier</a> <a href="?p=rmdvd&id_dvd='.$id.'">supprimer</a></td>';
		echo '</tr>';
	}
	echo '</list>';
?>
